package com.loukou.lkt.lkt.enums;

import java.util.HashMap;
import java.util.Map;

public enum SettlementTypeEnum {
	TYPE_MonthStm(0,"月结"),
	TYPE_HalfMonthStm(1,"半月结"),
	TYPE_WeekStm(2,"周结"),
	TYPE_TctPay (3,"票到付款"),
	TYPE_AdvPay(4,"预付款");
	private int id;
	private String name;
	private static Map<String,String> map = new HashMap<String, String>();
	private SettlementTypeEnum(int id, String name) {
		this.id = id;
		this.name = name;
	}
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public static SettlementTypeEnum parseSettlementTypeEnum(int id) {
		for (SettlementTypeEnum typeEnum : SettlementTypeEnum.values()) {
			if(typeEnum.id == id){
				return typeEnum;
			}
		}
		return TYPE_MonthStm;
	}
	
	public static HashMap<String, String> getMap() {
		for (SettlementTypeEnum typeEnum : SettlementTypeEnum.values()) {
			map.put(String.valueOf(typeEnum.id),typeEnum.name);
		}
		return (HashMap<String, String>) map;
	}
}
